<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <title>Example</title>
</head>

<body>
    <script type="text/javascript">
    var myData = {
        name: "Adam",
        weather: "sunny",
        printMessages: function() {
            document.writeln("Hello " + this.name + ". ");
            document.writeln("Today is " + this.weather + ".");
        }
    };

    for (var prop in myData) {
        document.writeln("Name: " + prop + " Value: " + myData[prop]);
    }
    </script>
</body>

</html>
